package com.intehel.controller;

import com.intehel.feign.StockFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

/**
 * @Description:
 * @Author: Kele
 * @CreateDate: 2022/5/30 16:20
 * @Version:
 */
@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private StockFeignService stockFeignService;

    @GetMapping("/add")
    @PreAuthorize("hasAnyAuthority('orderAdd')")
    public String add(){
        return "order-service success! " + stockFeignService.reduce();
    }
}
